import React, { Component } from 'react'
import * as echarts from 'echarts'
export default class App extends Component {
   //在此处进行初始化 
   componentDidMount(){
      const mychart=echarts.init(this.boxRef)
      let options={
         title:{
            text:'汽车销售平台TOP5'
         },
         xAxis:{
            data:['宝马','卡罗拉','思域','轩逸','雅阁']
         },
         yAxis:{},
         series:[
            {
                name:'汽车销售',
                type:'line',
                data:[900,879,345,234,666]
            }
         ]
      }
      mychart.setOption(options)
   }
 
   render() {
    const boxStyle={
        width:'500px',
        height:'400px',
        backgroundColor:'#ccc'
    }
    return (
      <>
        <div style={boxStyle} ref={arg=>this.boxRef=arg}></div>
      </>
    )
  }
}
